#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "uthash.h"

int findDuplicate(int* nums, int numsSize);

int main()
{
	return 0;
}

int findDuplicate(int* nums, int numsSize) {
	int slow = nums[0], fast = nums[slow];
	while (slow != fast) {
		slow = nums[slow];
		fast = nums[nums[fast]];
	}

	int finder = nums[0]; slow = nums[slow];
	while (slow != finder) {
		finder = nums[finder];
		slow = nums[slow];
	}
	return slow;
}
